package cn.wolfcode.mapper;

import cn.wolfcode.domain.Employee;
import cn.wolfcode.qo.EmplyeeQueryObject;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    void insertRelation(@Param("eid") Long eid, @Param("rid") Long rid);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    int selectForCount(EmplyeeQueryObject qo);

    List<Employee> selectForList(EmplyeeQueryObject qo);

    void insertBatchRelation(@Param("id") Long id, @Param("ids") Long[] ids);

    void deleteRelation(Long id);

    Employee selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    Employee selectByPassword(@Param("oldPassword") String oldPassword, @Param("id") Long id);

    void setPassword(@Param("id") Long id, @Param("newPassword") String newPassword);

    void batchDelete(Long[] ids);

    Employee selectByName(String name);

    List<Employee> selectByRoleSn(String... sns);

}